package cn.wolfcode.wolf2w.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import org.springframework.amqp.core.Queue;

@Component
public class StrategyRabbitConfig {
    /**
     * 策略队列
     */
    @Bean
    public Queue strategyQueue() {
        return new Queue("strategyQueue", true, false, false);
    }

    /**
     * 策略交换机
     */
    @Bean
    public TopicExchange strategyExchange() {
        return new TopicExchange("strategyExchange", true, false);
    }
    /**
     * 策略绑定关系
     * */
    @Bean
    public Binding strategyBinding() {
        return new Binding("strategyQueue", Binding.DestinationType.QUEUE,
                "strategyExchange", "strategy.#", null);
    }


}
